/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package cn.sliew.scaleph.plugin.seatunnel.flink.connectors.fake.source;

import cn.sliew.scaleph.plugin.framework.property.*;
import com.fasterxml.jackson.databind.JsonNode;

public enum FakeProperties {
    ;

    public static final PropertyDescriptor<JsonNode> TABLES_CONFIGS = new PropertyDescriptor.Builder<JsonNode>()
            .name("tables_configs")
            .description(
                    "Define Multiple FakeSource, each item can contains the whole fake source config description below")
            .type(PropertyType.OBJECT)
            .parser(Parsers.JSON_PARSER)
            .addValidator(Validators.NON_BLANK_VALIDATOR)
            .validateAndBuild();

    public static final PropertyDescriptor<JsonNode> SCHEMA = new PropertyDescriptor.Builder<JsonNode>()
            .name("schema")
            .description(
                    "Table structure description ,you should assign schema option to tell connector how to parse data to the row you want.")
            .type(PropertyType.OBJECT)
            .parser(Parsers.JSON_PARSER)
            .properties(Property.Required)
            .addValidator(Validators.NON_BLANK_VALIDATOR)
            .validateAndBuild();

    public static final PropertyDescriptor<Integer> ROW_NUM = new PropertyDescriptor.Builder<Integer>()
            .name("row.num")
            .description("Table structure description ,you should assign schema option to tell connector how to parse data to the row you want.")
            .type(PropertyType.INT)
            .parser(Parsers.INTEGER_PARSER)
            .defaultValue(5)
            .addValidator(Validators.POSITIVE_INTEGER_VALIDATOR)
            .validateAndBuild();

    public static final PropertyDescriptor<Integer> SPLIT_NUM = new PropertyDescriptor.Builder<Integer>()
            .name("split.num")
            .description("the number of splits generated by the enumerator for each degree of parallelism")
            .type(PropertyType.INT)
            .parser(Parsers.INTEGER_PARSER)
            .defaultValue(1)
            .addValidator(Validators.POSITIVE_INTEGER_VALIDATOR)
            .validateAndBuild();

    public static final PropertyDescriptor<Long> SPLIT_READ_INTERVAL = new PropertyDescriptor.Builder<Long>()
            .name("split.read-interval")
            .description("The interval(mills) between two split reads in a reader")
            .type(PropertyType.INT)
            .parser(Parsers.LONG_PARSER)
            .defaultValue(1)
            .addValidator(Validators.POSITIVE_LONG_VALIDATOR)
            .validateAndBuild();

    public static final PropertyDescriptor<Integer> MAP_SIZE = new PropertyDescriptor.Builder<Integer>()
            .name("map.size")
            .description("The size of map type that connector generated")
            .type(PropertyType.INT)
            .parser(Parsers.INTEGER_PARSER)
            .defaultValue(5)
            .addValidator(Validators.POSITIVE_INTEGER_VALIDATOR)
            .validateAndBuild();

    public static final PropertyDescriptor<Integer> ARRAY_SIZE = new PropertyDescriptor.Builder<Integer>()
            .name("array.size")
            .description("The size of array type that connector generated")
            .type(PropertyType.INT)
            .parser(Parsers.INTEGER_PARSER)
            .defaultValue(5)
            .addValidator(Validators.POSITIVE_INTEGER_VALIDATOR)
            .validateAndBuild();

    public static final PropertyDescriptor<Integer> BYTES_SIZE = new PropertyDescriptor.Builder<Integer>()
            .name("bytes.length")
            .description("The length of bytes type that connector generated")
            .type(PropertyType.INT)
            .parser(Parsers.INTEGER_PARSER)
            .defaultValue(5)
            .addValidator(Validators.POSITIVE_INTEGER_VALIDATOR)
            .validateAndBuild();

    public static final PropertyDescriptor<Integer> STRING_SIZE = new PropertyDescriptor.Builder<Integer>()
            .name("string.length")
            .description("The length of string type that connector generated")
            .type(PropertyType.INT)
            .parser(Parsers.INTEGER_PARSER)
            .defaultValue(5)
            .addValidator(Validators.POSITIVE_INTEGER_VALIDATOR)
            .validateAndBuild();

    public static final PropertyDescriptor<JsonNode> ROWS = new PropertyDescriptor.Builder<JsonNode>()
            .name("rows")
            .description(
                    "The row list of fake data output per degree of parallelism")
            .type(PropertyType.OBJECT)
            .parser(Parsers.JSON_PARSER)
            .addValidator(Validators.NON_BLANK_VALIDATOR)
            .validateAndBuild();

    public static final PropertyDescriptor<String> STRING_FAKE_MODE = new PropertyDescriptor.Builder()
            .name("string.fake.mode")
            .description("The fake mode of generating string data")
            .type(PropertyType.STRING)
            .parser(Parsers.STRING_PARSER)
            .defaultValue("range")
            .addValidator(Validators.NON_BLANK_VALIDATOR)
            .allowableValues("range", "template")
            .validateAndBuild();

    public static final PropertyDescriptor<JsonNode> STRING_TEMPLATE = new PropertyDescriptor.Builder()
            .name("string.template")
            .description("The template list of string type that connector generated")
            .type(PropertyType.OBJECT)
            .parser(Parsers.JSON_PARSER)
            .addValidator(Validators.NON_BLANK_VALIDATOR)
            .validateAndBuild();

    public static final PropertyDescriptor<String> TINYINT_FAKE_MODE = new PropertyDescriptor.Builder()
            .name("tinyint.fake.mode")
            .description("The fake mode of generating tinyint data")
            .type(PropertyType.STRING)
            .parser(Parsers.STRING_PARSER)
            .defaultValue("range")
            .addValidator(Validators.NON_BLANK_VALIDATOR)
            .allowableValues("range", "template")
            .validateAndBuild();

    public static final PropertyDescriptor<Integer> TINYINT_MIN = new PropertyDescriptor.Builder()
            .name("tinyint.min")
            .description("The min value of tinyint data that connector generated")
            .type(PropertyType.INT)
            .parser(Parsers.INTEGER_PARSER)
            .defaultValue(0)
            .addValidator(Validators.NON_NEGATIVE_INTEGER_VALIDATOR)
            .validateAndBuild();

    public static final PropertyDescriptor<Integer> TINYINT_MAX = new PropertyDescriptor.Builder()
            .name("tinyint.max")
            .description("The max value of tinyint data that connector generated")
            .type(PropertyType.INT)
            .parser(Parsers.INTEGER_PARSER)
            .defaultValue(Byte.MAX_VALUE)
            .addValidator(Validators.NON_NEGATIVE_INTEGER_VALIDATOR)
            .validateAndBuild();

    public static final PropertyDescriptor<JsonNode> TINYINT_TEMPLATE = new PropertyDescriptor.Builder()
            .name("tinyint.template")
            .description("The template list of tinyint type that connector generated")
            .type(PropertyType.OBJECT)
            .parser(Parsers.JSON_PARSER)
            .addValidator(Validators.NON_BLANK_VALIDATOR)
            .validateAndBuild();

    public static final PropertyDescriptor<String> SMALLINT_FAKE_MODE = new PropertyDescriptor.Builder()
            .name("smallint.fake.mode")
            .description("The fake mode of generating smallint data")
            .type(PropertyType.STRING)
            .parser(Parsers.STRING_PARSER)
            .defaultValue("range")
            .addValidator(Validators.NON_BLANK_VALIDATOR)
            .allowableValues("range", "template")
            .validateAndBuild();

    public static final PropertyDescriptor<Integer> SMALLINT_MIN = new PropertyDescriptor.Builder()
            .name("smallint.min")
            .description("The min value of smallint data that connector generated")
            .type(PropertyType.INT)
            .parser(Parsers.INTEGER_PARSER)
            .defaultValue(0)
            .addValidator(Validators.NON_NEGATIVE_INTEGER_VALIDATOR)
            .validateAndBuild();

    public static final PropertyDescriptor<Integer> SMALLINT_MAX = new PropertyDescriptor.Builder()
            .name("smallint.max")
            .description("The max value of smallint data that connector generated")
            .type(PropertyType.INT)
            .parser(Parsers.INTEGER_PARSER)
            .defaultValue(Short.MAX_VALUE)
            .addValidator(Validators.NON_NEGATIVE_INTEGER_VALIDATOR)
            .validateAndBuild();

    public static final PropertyDescriptor<JsonNode> SMALLINT_TEMPLATE = new PropertyDescriptor.Builder()
            .name("smallint.template")
            .description("The template list of smallint type that connector generated")
            .type(PropertyType.OBJECT)
            .parser(Parsers.JSON_PARSER)
            .addValidator(Validators.NON_BLANK_VALIDATOR)
            .validateAndBuild();

    public static final PropertyDescriptor<String> INT_FAKE_MODE = new PropertyDescriptor.Builder()
            .name("int.fake.mode")
            .description("The fake mode of generating int data")
            .type(PropertyType.STRING)
            .parser(Parsers.STRING_PARSER)
            .defaultValue("range")
            .addValidator(Validators.NON_BLANK_VALIDATOR)
            .allowableValues("range", "template")
            .validateAndBuild();

    public static final PropertyDescriptor<Integer> INT_MIN = new PropertyDescriptor.Builder()
            .name("int.min")
            .description("The min value of int data that connector generated")
            .type(PropertyType.INT)
            .parser(Parsers.INTEGER_PARSER)
            .defaultValue(0)
            .addValidator(Validators.NON_NEGATIVE_INTEGER_VALIDATOR)
            .validateAndBuild();

    public static final PropertyDescriptor<Integer> INT_MAX = new PropertyDescriptor.Builder()
            .name("int.max")
            .description("The max value of int data that connector generated")
            .type(PropertyType.INT)
            .parser(Parsers.INTEGER_PARSER)
            .defaultValue(Integer.MAX_VALUE)
            .addValidator(Validators.NON_NEGATIVE_INTEGER_VALIDATOR)
            .validateAndBuild();

    public static final PropertyDescriptor<JsonNode> INT_TEMPLATE = new PropertyDescriptor.Builder()
            .name("int.template")
            .description("The template list of int type that connector generated")
            .type(PropertyType.OBJECT)
            .parser(Parsers.JSON_PARSER)
            .addValidator(Validators.NON_BLANK_VALIDATOR)
            .validateAndBuild();

    public static final PropertyDescriptor<String> BIGINT_FAKE_MODE = new PropertyDescriptor.Builder()
            .name("bigint.fake.mode")
            .description("The fake mode of generating int data")
            .type(PropertyType.STRING)
            .parser(Parsers.STRING_PARSER)
            .defaultValue("range")
            .addValidator(Validators.NON_BLANK_VALIDATOR)
            .allowableValues("range", "template")
            .validateAndBuild();

    public static final PropertyDescriptor<Integer> BIGINT_MIN = new PropertyDescriptor.Builder()
            .name("bigint.min")
            .description("The min value of int data that connector generated")
            .type(PropertyType.INT)
            .parser(Parsers.LONG_PARSER)
            .defaultValue(0)
            .addValidator(Validators.LONG_VALIDATOR)
            .validateAndBuild();

    public static final PropertyDescriptor<Integer> BIGINT_MAX = new PropertyDescriptor.Builder()
            .name("bigint.max")
            .description("The max value of int data that connector generated")
            .type(PropertyType.INT)
            .parser(Parsers.LONG_PARSER)
            .defaultValue(Long.MAX_VALUE)
            .addValidator(Validators.LONG_VALIDATOR)
            .validateAndBuild();

    public static final PropertyDescriptor<JsonNode> BIGINT_TEMPLATE = new PropertyDescriptor.Builder()
            .name("bigint.template")
            .description("The template list of int type that connector generated")
            .type(PropertyType.OBJECT)
            .parser(Parsers.JSON_PARSER)
            .addValidator(Validators.NON_BLANK_VALIDATOR)
            .validateAndBuild();

    public static final PropertyDescriptor<String> FLOAT_FAKE_MODE = new PropertyDescriptor.Builder()
            .name("float.fake.mode")
            .description("The fake mode of generating float data")
            .type(PropertyType.STRING)
            .parser(Parsers.STRING_PARSER)
            .defaultValue("range")
            .addValidator(Validators.NON_BLANK_VALIDATOR)
            .allowableValues("range", "template")
            .validateAndBuild();

    public static final PropertyDescriptor<Integer> FLOAT_MIN = new PropertyDescriptor.Builder()
            .name("float.min")
            .description("The min value of float data that connector generated")
            .type(PropertyType.INT)
            .parser(Parsers.FLOAT_PARSER)
            .defaultValue(0)
            .addValidator(Validators.NUMBER_VALIDATOR)
            .validateAndBuild();

    public static final PropertyDescriptor<Integer> FLOAT_MAX = new PropertyDescriptor.Builder()
            .name("float.max")
            .description("The max value of float data that connector generated")
            .type(PropertyType.INT)
            .parser(Parsers.FLOAT_PARSER)
            .defaultValue(Float.MAX_VALUE)
            .addValidator(Validators.NUMBER_VALIDATOR)
            .validateAndBuild();

    public static final PropertyDescriptor<JsonNode> FLOAT_TEMPLATE = new PropertyDescriptor.Builder()
            .name("float.template")
            .description("The template list of float type that connector generated")
            .type(PropertyType.OBJECT)
            .parser(Parsers.JSON_PARSER)
            .addValidator(Validators.NON_BLANK_VALIDATOR)
            .validateAndBuild();


    public static final PropertyDescriptor<String> DOUBLE_FAKE_MODE = new PropertyDescriptor.Builder()
            .name("double.fake.mode")
            .description("The fake mode of generating double data")
            .type(PropertyType.STRING)
            .parser(Parsers.STRING_PARSER)
            .defaultValue("range")
            .addValidator(Validators.NON_BLANK_VALIDATOR)
            .allowableValues("range", "template")
            .validateAndBuild();

    public static final PropertyDescriptor<Integer> DOUBLE_MIN = new PropertyDescriptor.Builder()
            .name("double.min")
            .description("The min value of double data that connector generated")
            .type(PropertyType.INT)
            .parser(Parsers.DOUBLE_PARSER)
            .defaultValue(0)
            .addValidator(Validators.NUMBER_VALIDATOR)
            .validateAndBuild();

    public static final PropertyDescriptor<Integer> DOUBLE_MAX = new PropertyDescriptor.Builder()
            .name("double.max")
            .description("The max value of double data that connector generated")
            .type(PropertyType.INT)
            .parser(Parsers.DOUBLE_PARSER)
            .defaultValue(Double.MAX_VALUE)
            .addValidator(Validators.NUMBER_VALIDATOR)
            .validateAndBuild();

    public static final PropertyDescriptor<JsonNode> DOUBLE_TEMPLATE = new PropertyDescriptor.Builder()
            .name("double.template")
            .description("The template list of double type that connector generated")
            .type(PropertyType.OBJECT)
            .parser(Parsers.JSON_PARSER)
            .addValidator(Validators.NON_BLANK_VALIDATOR)
            .validateAndBuild();


    public static final PropertyDescriptor<JsonNode> DATE_YEAR_TEMPLATE = new PropertyDescriptor.Builder()
            .name("date.year.template")
            .description("The template list of year of date like 'yyyy', if user configured it, connector will randomly select an item from the template list")
            .type(PropertyType.OBJECT)
            .parser(Parsers.JSON_PARSER)
            .addValidator(Validators.NON_BLANK_VALIDATOR)
            .validateAndBuild();

    public static final PropertyDescriptor<JsonNode> DATE_MONTH_TEMPLATE = new PropertyDescriptor.Builder()
            .name("date.month.template")
            .description("The template list of month of date like 'MM', if user configured it, connector will randomly select an item from the template list")
            .type(PropertyType.OBJECT)
            .parser(Parsers.JSON_PARSER)
            .addValidator(Validators.NON_BLANK_VALIDATOR)
            .validateAndBuild();

    public static final PropertyDescriptor<JsonNode> DATE_DAY_TEMPLATE = new PropertyDescriptor.Builder()
            .name("date.day.template")
            .description("The template list of day of date like 'dd', if user configured it, connector will randomly select an item from the template list")
            .type(PropertyType.OBJECT)
            .parser(Parsers.JSON_PARSER)
            .addValidator(Validators.NON_BLANK_VALIDATOR)
            .validateAndBuild();

    public static final PropertyDescriptor<JsonNode> TIME_HOUR_TEMPLATE = new PropertyDescriptor.Builder()
            .name("time.hour.template")
            .description("The template list of hour of time like 'HH', if user configured it, connector will randomly select an item from the template list")
            .type(PropertyType.OBJECT)
            .parser(Parsers.JSON_PARSER)
            .addValidator(Validators.NON_BLANK_VALIDATOR)
            .validateAndBuild();

    public static final PropertyDescriptor<JsonNode> TIME_MINUTE_TEMPLATE = new PropertyDescriptor.Builder()
            .name("time.minute.template")
            .description("The template list of minute of time like 'mm', if user configured it, connector will randomly select an item from the template list")
            .type(PropertyType.OBJECT)
            .parser(Parsers.JSON_PARSER)
            .addValidator(Validators.NON_BLANK_VALIDATOR)
            .validateAndBuild();

    public static final PropertyDescriptor<JsonNode> TIME_SECOND_TEMPLATE = new PropertyDescriptor.Builder()
            .name("time.second.template")
            .description("The template list of second of time like 'ss', if user configured it, connector will randomly select an item from the template list")
            .type(PropertyType.OBJECT)
            .parser(Parsers.JSON_PARSER)
            .addValidator(Validators.NON_BLANK_VALIDATOR)
            .validateAndBuild();

}
